home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / CHIP Kasım 1996.iso / ms / visualj / vjtrialb.exe / RCDATA / CABINET / MFCAPWZ.DLL / TEMPLATE / FRAME.CPP < prev    next >
C/C++ Source or Header  |  1996-07-31  |  4KB  |  162 lines

  1. // $$frame_ifile$$.cpp : implementation of the $$FRAME_CLASS$$ class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "$$root$$.h"
  6.  
  7. #include "$$frame_hfile$$.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // $$FRAME_CLASS$$
  17.  
  18. $$IF(PROJTYPE_MDI)
  19. IMPLEMENT_DYNAMIC($$FRAME_CLASS$$, $$FRAME_BASE_CLASS$$)
  20. $$ELSE
  21. IMPLEMENT_DYNCREATE($$FRAME_CLASS$$, $$FRAME_BASE_CLASS$$)
  22. $$ENDIF
  23.  
  24. BEGIN_MESSAGE_MAP($$FRAME_CLASS$$, $$FRAME_BASE_CLASS$$)
  25.     //{{AFX_MSG_MAP($$FRAME_CLASS$$)
  26. $$IF(VERBOSE)
  27.         // NOTE - the ClassWizard will add and remove mapping macros here.
  28.         //    DO NOT EDIT what you see in these blocks of generated code !
  29. $$ENDIF
  30. $$IF(TOOLBAR || STATUSBAR)
  31.     ON_WM_CREATE()
  32. $$ENDIF //TOOLBAR || STATUSBAR
  33.     //}}AFX_MSG_MAP
  34. $$IF(HELP)
  35.     // Global help commands
  36.     ON_COMMAND(ID_HELP_FINDER, $$FRAME_BASE_CLASS$$::OnHelpFinder)
  37.     ON_COMMAND(ID_HELP, $$FRAME_BASE_CLASS$$::OnHelp)
  38.     ON_COMMAND(ID_CONTEXT_HELP, $$FRAME_BASE_CLASS$$::OnContextHelp)
  39.     ON_COMMAND(ID_DEFAULT_HELP, $$FRAME_BASE_CLASS$$::OnHelpFinder)
  40. $$ENDIF
  41. END_MESSAGE_MAP()
  42. $$IF(STATUSBAR)
  43.  
  44. static UINT indicators[] =
  45. {
  46.     ID_SEPARATOR,           // status line indicator
  47.     ID_INDICATOR_CAPS,
  48.     ID_INDICATOR_NUM,
  49.     ID_INDICATOR_SCRL,
  50. };
  51. $$ENDIF //STATUSBAR
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // $$FRAME_CLASS$$ construction/destruction
  55.  
  56. $$FRAME_CLASS$$::$$FRAME_CLASS$$()
  57. {
  58. $$IF(VERBOSE)
  59.     // TODO: add member initialization code here
  60.     
  61. $$ENDIF
  62. }
  63.  
  64. $$FRAME_CLASS$$::~$$FRAME_CLASS$$()
  65. {
  66. }
  67. $$IF(TOOLBAR || STATUSBAR)
  68.  
  69. int $$FRAME_CLASS$$::OnCreate(LPCREATESTRUCT lpCreateStruct)
  70. {
  71.     if ($$FRAME_BASE_CLASS$$::OnCreate(lpCreateStruct) == -1)
  72.         return -1;
  73. $$IF(TOOLBAR)
  74.     
  75.     if (!m_wndToolBar.Create(this) ||
  76.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  77.     {
  78.         TRACE0("Failed to create toolbar\n");
  79.         return -1;      // fail to create
  80.     }
  81. $$ENDIF //TOOLBAR
  82. $$IF(STATUSBAR)
  83.  
  84.     if (!m_wndStatusBar.Create(this) ||
  85.         !m_wndStatusBar.SetIndicators(indicators,
  86.           sizeof(indicators)/sizeof(UINT)))
  87.     {
  88.         TRACE0("Failed to create status bar\n");
  89.         return -1;      // fail to create
  90.     }
  91. $$ENDIF //STATUSBAR
  92. $$IF(TOOLBAR)
  93.  
  94. $$IF(VERBOSE)    
  95.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  96. $$ENDIF
  97.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  98.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  99.  
  100. $$IF(VERBOSE)
  101.     // TODO: Delete these three lines if you don't want the toolbar to
  102.     //  be dockable
  103. $$ENDIF
  104.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  105.     EnableDocking(CBRS_ALIGN_ANY);
  106.     DockControlBar(&m_wndToolBar);
  107. $$ENDIF //TOOLBAR    
  108.  
  109.     return 0;
  110. }
  111. $$ENDIF //TOOLBAR || STATUSBAR
  112. $$IF(SPLITTER_SDI)
  113.  
  114. BOOL $$FRAME_CLASS$$::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
  115.     CCreateContext* pContext)
  116. {
  117.     return m_wndSplitter.Create( this,
  118. $$IF(VERBOSE)
  119.         2, 2,                 // TODO: adjust the number of rows, columns
  120.         CSize( 10, 10 ),      // TODO: adjust the minimum pane size
  121. $$ELSE //!VERBOSE
  122.         2, 2,
  123.         CSize( 10, 10 ),
  124. $$ENDIF //VERBOSE
  125.         pContext );
  126. }
  127. $$ENDIF //SPLITTER
  128.  
  129. BOOL $$FRAME_CLASS$$::PreCreateWindow(CREATESTRUCT& cs)
  130. {
  131. $$IF(VERBOSE)
  132.     // TODO: Modify the Window class or styles here by modifying
  133.     //  the CREATESTRUCT cs
  134.  
  135. $$ENDIF //VERBOSE
  136. $$IF(FRAME_STYLES)
  137.     cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
  138.         $$FRAME_STYLE_FLAGS$$;
  139.  
  140. $$ENDIF //FRAME_STYLES
  141.     return $$FRAME_BASE_CLASS$$::PreCreateWindow(cs);
  142. }
  143.  
  144. /////////////////////////////////////////////////////////////////////////////
  145. // $$FRAME_CLASS$$ diagnostics
  146.  
  147. #ifdef _DEBUG
  148. void $$FRAME_CLASS$$::AssertValid() const
  149. {
  150.     $$FRAME_BASE_CLASS$$::AssertValid();
  151. }
  152.  
  153. void $$FRAME_CLASS$$::Dump(CDumpContext& dc) const
  154. {
  155.     $$FRAME_BASE_CLASS$$::Dump(dc);
  156. }
  157.  
  158. #endif //_DEBUG
  159.  
  160. /////////////////////////////////////////////////////////////////////////////
  161. // $$FRAME_CLASS$$ message handlers
  162.